
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>

        <script type="text/javascript" src="jquery-1.9.1.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $("div#content-ajax").click(function() {

                    $.get("BasicServlet", function(data, status) {
                        $("div#toExtend").html(data)
                        alert("Done, with the following status: " + status + "." +
                              " Here is the response: " + data);
                    }, "html");
                });

            });

        </script>
    </head>
    <body>
        <h1>Hello World!</h1>
        <div id="content-ajax">Initial content</div>
        <div id="toExtend"></div>
    </body>
</html>
